-
Notifications
You must be signed in to change notification settings - Fork 948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(spv): shader debug option #4028
Conversation
0a4039c
to
88e83c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this flag only applies to spirv-out I'm wondering we could find another way to specify this instead of putting it on every ShaderModuleDescriptor
That said, maybe this is something we could expose for more inputs - @teoxoy can you comment on that? If we can make more use of that it's surely a useful pattern, otherwise I'm a bit on the fence, but still pondering what might be better there. We should definitely expose this somehow
Honestly I have the same thought on it while writing, but I didn't want to changing the Now I have two idea:
i vote for the second plan, because this will leave |
This kind of switch shows up in multiple places and is likely okay being a instance level switch for all shaders from the instance. We have a couple things that we want to be able to adjust on the instance level, including turning on/off underlying-api validation, debug labels, and graphics debugger integrations. I'm going to make a instance flags in a PR shortly and this can use that. |
Ping from triage |
Sorry for taking a while to respond on this but I think what @cwfitzgerald has in mind sounds good to me. |
To clarify, I will implement the flags in general very soon, then you can merge on top of that work |
Firefox wants this. We want to be able to enable the backend's debugging layers in non-debug Firefox builds, for fuzzing and things like that. |
#2316 is the main issue for the flags |
#4230 has now landed, giving you a flag to latch onto! |
sure! I will take some time to integrate |
#4246 adds the plumbing to access the instance flags from the instance or the device. |
dbe5c82
to
b7de7fd
Compare
b7de7fd
to
e423f58
Compare
Checklist
cargo clippy
.cargo clippy --target wasm32-unknown-unknown
if applicable.Connections
#3896
Description
Generate shader debug info for spv
Testing
There are some spv level tests in naga already. Testing with frame debugger is hard to make an autotest.
So the following step needs done by hands:
add debug flag to the shader macro
wgpu::include_wgsl!("shader.wgsl", true));
or use structMake sure wgpu is using Vulkan backend.
Launch compiled exe from Renderdoc and capture a frame and trigger the shader debugger via vertex or pixel.
press F10 to step over and F10+shift to step back.
Test on Win10 19045.3324, Nvidia.
I also tried other debugger like PIX, Nsight, but only Renderdoc support vulkan+spv debug.
I'll test Linux+Renderdoc later.